<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>闪购</title>
		<link rel="stylesheet" type="text/css" href="css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="css/compound.css" />
		<link rel="stylesheet" type="text/css" href="font/iconfont.css" />
		<script src="js/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/compound.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div id="shangou_head">
			<div class="head">
			<!--定位导航-->
			<div id="head-top" class="w">
				<div id="head-top-content" class="h">
					<ul class="head-top-ul1 h">
						<li><i class="iconfont icon-hongjiuchengiconhongjiucheng icon-home"></i>当前城市：</li>
						<li class="head-display-par" id="head-display-a">
							<i class="iconfont icon-dangqianchengshi  icon-down"></i>
							<a href="javascript:;" class="head-a">北京</a>
							<div id="head-display">
								<p class="head-display-city">
									<a href="javascript:;">北京</a>
									<a href="javascript:;">上海</a>
									<a href="javascript:;">天津</a>
									<a href="javascript:;">重庆</a>
								</p>
								<p class="head-display-city">
									<a href="javascript:;">山西</a>
									<a href="javascript:;">河北</a>
									<a href="javascript:;">河南</a>
									<a href="javascript:;">辽宁</a>
								</p>
								<p class="head-display-city">
									<a href="javascript:;">吉林</a>
									<a href="javascript:;">陕西</a>
									<a href="javascript:;">深圳</a>
									<a href="javascript:;">江苏</a>
								</p>
								<p class="head-display-city">
									<a href="javascript:;">山东</a>
									<a href="javascript:;">安徽</a>
									<a href="javascript:;">浙江</a>
									<a href="javascript:;">福建</a>
								</p>
								<p class="head-display-city">
									<a href="javascript:;">湖北</a>
									<a href="javascript:;">湖南</a>
									<a href="javascript:;">广东</a>
									<a href="javascript:;">江西</a>
								</p>
								<p class="head-display-city">
									<a href="javascript:;">海南</a>
									<a href="javascript:;">贵州</a>
									<a href="javascript:;">宁夏</a>

									<a href="javascript:;">黑龙江</a>

								</p>
							</div>
						</li>
						<li>你好，欢迎进入!</li>
						<li>
							<a class="head-a" href="login.html">登录</a>
						</li>
						<li>
							<a class="head-a" href="register.html">注册</a>
						</li>
						<!--<li>
							<a class="head-a" href="index.html">首页</a>
						</li>-->
					</ul>

					<ul class="head-top-ul2 h">
						<li class="head-position-par">
							<a class="head-a" href="javascript:;">我的账户</a><i class="iconfont icon-arrowDown icon-down"></i>
							<div class="head-myself">
								<p class="head-myself-children">
									<a href="order.html">我的订单</a>
								</p>
								<p class="head-myself-children">
									<a href="javascript:;">我的资料</a>
								</p>
								<p class="head-myself-children">
									<a href="javascript:;">我的收藏</a>
								</p>
								<p class="head-myself-children">
									<a href="shopping.html">我的购物车</a>
								</p>
								<p class="head-myself-children">
									<a href="javascript:;">我的关注</a>
								</p>
							</div>
						</li>
						<li><i class="iconfont icon-tubiaoshangcheng icon-down"></i>
							<a class="head-a" href="shopping.html">购物车<span class="head-number">1</span>件</a>
						</li>
						<li>
							<a class="head-a" href="javascript:;">客户服务</a>
						</li>
						<li>
							<a class="head-a" href="javascript:;">大客户</a>
						</li>
					</ul>
				</div>
			</div>
			
				
			<!--logo，搜索内容显示位置-->
			<div id="head-content">
				<!--logo-->
				<div class="head-content-left">
					<img src="img/logo.png"/>
				</div>
				<!--搜索-->
				<div class="head-content-search">
					<p class="head-p"><i class="iconfont icon-sou icon-search f16"></i><input type="text" class="head-input" /><input type="button" class="head-btn" value="搜索" /></p>
					<div class="head-p2">
						<ul class="head-ul3 h">
							<li>
								<a class="head-a" href="javascript:;">红酒</a>
							</li>
							<li>
								<a class="head-a" href="javascript:;">葡萄酒</a>
							</li>
							<li>
								<a class="head-a" href="javascript:;">奔富</a>
							</li>
							<li>
								<a class="head-a" href="javascript:;">轩尼诗</a>
							</li>
							<li>
								<a class="head-a" href="javascript:;">拉菲</a>
							</li>
						</ul>
					</div>
				</div>
				<!--二维码-->
				<div class="head-content-right"><img src="img/erweima.jpg" /></div>
				
			</div>
			<div class="head-border w"></div>
		</div>
	
		</div>
		
		<div id="shangou_bg">
			<div id="shangou_bg_main">
				<div id="shangou_bg_main_submenu">
					<div>闪购频道</div>
					<span class="hover">今日闪购</span>
					<span>明日预告</span>
				</div>
				<div id="shangou_bg_main_shangou">
					<div class="shangou-index"><a href="index.html">首页</a></div>
					<div class="sign">
						<p>今日闪购</p>
						<em>十点准时开抢！</em>
						<div class="daojishi">
							<span class="hh"></span>
							<span class="mm"></span>
							<span class="ss"></span>
						</div>
					</div>
					<div class="leading">
						<ul>
							<li>
								<div class="lead_img"><a href=""><img src="" /></a></div>
								<div class="lead_txt">
									<span class="jieshao"></span>
									<p><a href="">安第斯阳光酒园 特选系列西拉干红葡萄酒</a></p>
									<label>闪购价：<em class="shangou"></em></label>
								</div>
							</li>
	                        <li>
								<div class="lead_img"><a href=""><img src="" /></a></div>
								<div class="lead_txt">
									<span class="jieshao"></span>
									<p><a href="">嘉诚庄园荣誉酿酒师干白葡萄酒</a></p>
									
									<label>闪购价：<em class="shangou"></em></label>
								</div>
							</li>
							<li>
								<div class="lead_img"><a href=""><img src="" /></a></div>
								<div class="lead_txt">
									<span class="jieshao"></span>
									<p><a href="">莱德庄园干红葡萄酒</a></p>
									
									<label>闪购价：<em class="shangou"></em></label>
								</div>
							</li>
							<li>
								<div class="lead_img"><a href=""><img src="" /></a></div>
								<div class="lead_txt">
									<span class="jieshao"></span>
									<p><a href=""></a></p>
									
									<label>闪购价：<em class="shangou"></em></label>
								</div>
							</li>
							<li>
								<div class="lead_img"><a href=""><img src="" /></a></div>
								<div class="lead_txt">
									<span class="jieshao"></span>
									<p><a href="">【名庄】卡农庄园正牌干红葡萄酒 2009</a></p>
								
									<label>闪购价：<em class="shangou"></em></label>
								</div>
							</li>
							<li>
								<div class="lead_img"><a href=""><img src="" /></a></div>
								<div class="lead_txt">
									<span class="jieshao"></span>
									<p><a href="">【名庄】碧尚女爵庄园正牌干红葡萄酒 2009</a></p>
									<label>闪购价：<em class="shangou"></em></label>
								</div>
							</li>
						
						</ul>
					</div>
					<div class="choose">
						推荐美酒
						<em></em>
					</div>
					<div class="content">
						<ul>
							<li>
								<div class="details">
									<!--图标-->
									<p style="width: 100%;">
										<img src="img/diaznan.png"/>
									入口润滑，平衡感好</p>
									<a href="" class="details-miaoshu"></a>
									<p><label><em class="detalis-shangou"></em></label></p>
									<div class="details_img"><a href=""><img src="" /></a></div>
								</div>
								<div class="shoucang">
									<span class="left"></span>
									<p><span></span>距结束：<span class="hh"></span>时<span class="mm"></span>分<span class="ss"></span>秒<span class="xingxing"></span><label>收藏</label></p>
									<span class="right"></span>
								</div>
								<div class="hover">
									<p><label><em class="detalis-shangou-1" style="font-size: 18px;"></em></label><b>加入购物车</b></p><span></span>
								</div>
							</li>
						<li>
								<div class="details">
									<!--图标-->
									<p style="width: 100%;">
										<img src="img/diaznan.png"/>
									入口润滑，平衡感好</p>
									<a href="" class="details-miaoshu"></a>
									<p><label><em class="detalis-shangou"></em></label></p>
									<div class="details_img"><a href=""><img src="" /></a></div>
								</div>
								<div class="shoucang">
									<span class="left"></span>
									<p><span></span>距结束：<span class="hh"></span>时<span class="mm"></span>分<span class="ss"></span>秒<span class="xingxing"></span><label>收藏</label></p>
									<span class="right"></span>
								</div>
								<div class="hover">
									<p><label><em class="detalis-shangou-1" style="font-size: 18px;"></em></label><b>加入购物车</b></p><span></span>
								</div>
							</li>
							<li>
								<div class="details">
									<!--图标-->
									<p style="width: 100%;">
										<img src="img/diaznan.png"/>
									入口润滑，平衡感好</p>
									<a href="" class="details-miaoshu"></a>
									<p><label><em class="detalis-shangou"></em></label></p>
									<div class="details_img"><a href=""><img src="" /></a></div>
								</div>
								<div class="shoucang">
									<span class="left"></span>
									<p><span></span>距结束：<span class="hh"></span>时<span class="mm"></span>分<span class="ss"></span>秒<span class="xingxing"></span><label>收藏</label></p>
									<span class="right"></span>
								</div>
								<div class="hover">
									<p><label><em class="detalis-shangou-1" style="font-size: 18px;"></em></label><b>加入购物车</b></p><span></span>
								</div>
							</li>
							<li>
								<div class="details">
									<!--图标-->
									<p style="width: 100%;">
										<img src="img/diaznan.png"/>
									入口润滑，平衡感好</p>
									<a href="" class="details-miaoshu"></a>
									<p><label><em class="detalis-shangou"></em></label></p>
									<div class="details_img"><a href=""><img src="" /></a></div>
								</div>
								<div class="shoucang">
									<span class="left"></span>
									<p><span></span>距结束：<span class="hh"></span>时<span class="mm"></span>分<span class="ss"></span>秒<span class="xingxing"></span><label>收藏</label></p>
									<span class="right"></span>
								</div>
								<div class="hover">
									<p><label><em class="detalis-shangou-1" style="font-size: 18px;" ></em></label><b>加入购物车</b></p><span></span>
								</div>
							</li>
							<li>
								<div class="details">
									<!--图标-->
									<p style="width: 100%;">
										<img src="img/diaznan.png"/>
									入口润滑，平衡感好</p>
									<a href="" class="details-miaoshu"></a>
									<p><label><em class="detalis-shangou"></em></label></p>
									<div class="details_img"><a href=""><img src="" /></a></div>
								</div>
								<div class="shoucang">
									<span class="left"></span>
									<p><span></span>距结束：<span class="hh"></span>时<span class="mm"></span>分<span class="ss"></span>秒<span class="xingxing"></span><label>收藏</label></p>
									<span class="right"></span>
								</div>
								<div class="hover">
									<p><label><em class="detalis-shangou-1" style="font-size: 18px;"></em></label><b>加入购物车</b></p><span></span>
								</div>
							</li>
							<li>
								<div class="details">
									<!--图标-->
									<p style="width: 100%;">
										<img src="img/diaznan.png"/>
									入口润滑，平衡感好</p>
									<a href="" class="details-miaoshu"></a>
									<p><label><em class="detalis-shangou"></em></label></p>
									<div class="details_img"><a href=""><img src="" /></a></div>
								</div>
								<div class="shoucang">
									<span class="left"></span>
									<p><span></span>距结束：<span class="hh"></span>时<span class="mm"></span>分<span class="ss"></span>秒<span class="xingxing"></span><label>收藏</label></p>
									<span class="right"></span>
								</div>
								<div class="hover">
									<p><label><em class="detalis-shangou-1" style="font-size: 18px;"></em></label><b>加入购物车</b></p><span></span>
								</div>
							</li>
			
						

						</ul>
					</div>
				</div>

		
				<div id="shangou_bg_jcpd">
					<p><span class="fl"></span>精彩频道<span class="fr"></span></p>
					<ul class="dibu-img">
						<li><a href=""><img src="" /></a></li>
						<li><a href=""><img src="" /></a></li>
						<li><a href=""><img src="" /></a></li>
						

					</ul>
				</div>
			</div>

		</div>

		<script src="js/jquery1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/av-min-2.1.2.js" type="text/javascript">
			
		</script>
		
		<script type="text/javascript">
			//先进行初始化函数
			window.onload = function() {
				var APP_ID = 'isetgclNbinuVRR2cWjIAsc2-gzGzoHsz';
				var APP_KEY = 'iB12WgD1FTr8FGQNB0JSsrah';
				AV.init({
					appId: APP_ID,
					appKey: APP_KEY
				});
				var currentUser = AV.User.current();
//				if(currentUser) {
//					console.log(currentUser._serverData.username);
////					console.log("是当前用户")
//						//$("#name").html(currentUser._serverData.username);
//						// 跳转到首页
//				} else {
//					//currentUser 为空时，可打开用户注册界面…
//					//location.href = "load.html?dataURL=list.html";
//					console.log("不是当前用户");
//				}
				//查询商品
				var query = new AV.Query('Product');
				//第几条数据开始
				var startDateQuery = new AV.Query('Product');
				startDateQuery.greaterThanOrEqualTo('id', "1186");
				//第几条数据结束
				var endDateQuery = new AV.Query('Product');
				endDateQuery.lessThan('id', "1213");
				var query = AV.Query.and(startDateQuery, endDateQuery);
				query.find().then(function(product) {
					//这里做查询到结果后的操作
					console.log(product);
					$(".lead_img img").each(function  (i) {
						console.log($(this));
						$(this).attr("src",product[i].attributes.image.split(";")[5]);
						$(this).parents().attr("href","xiangqing.html?id="+product[i].attributes.id+""); 
					});
					
					$(".jieshao").each(function  (i) {
						$(this).html(product[i].attributes.title);
						$(this).next().children().attr("href","xiangqing.html?id="+product[i].attributes.id+"");
					});
					$(".shangou").each(function  (i) {
						$(this).html(product[i].attributes.price);
						
					});
					$(".details-miaoshu").each(function  (i) {
						$(this).html(product[i+7].attributes.title);
						$(this).attr("href","xiangqing.html?id="+product[i+7].attributes.id+"");
					});
					$(".detalis-shangou").each(function  (i) {
						$(this).html(product[i+7].attributes.price);
						
					});
					$(".detalis-shangou-1").each(function  (i) {
						$(this).html(product[i+7].attributes.price);
						
					});
					$(".details_img img").each(function  (i) {
						$(this).attr("src",product[i+7].attributes.image.split(";")[0]);
						$(this).parent().attr("href","xiangqing.html?id="+product[i+7].attributes.id+"");
					});
					$(".dibu-img li img").each(function (i) {
						$(this).attr("src",product[i+13].attributes.image.split(";")[0]);
						
					})

					
				})
				
				}
			
			
			
			
			
			
			function daojishi() {
				var time = new Date();
				var hh = time.getHours();
				var mm = time.getMinutes();
				var ss = time.getSeconds();
				$(".hh").html(((33 - hh) > 23 ? 33 - hh - 24 : 33 - hh) < 10 ? "0" + ((33 - hh) > 23 ? 33 - hh - 24 : 33 - hh) : ((33 - hh) > 23 ? 33 - hh - 24 : 33 - hh));
				$(".mm").html((59 - mm) < 10 ? "0" + (59 - mm) : (59 - mm));
				$(".ss").html((59 - ss) < 10 ? "0" + (59 - ss) : (59 - ss));
			}
			daojishi()
			setInterval(function() {
				daojishi()
			}, 1000)
			$(".content li").hover(function() {
				$(this).find($(".content .hover")).animate({
					"left": 0
				}, 200)
			}, function() {
				$(this).find($(".content .hover")).animate({
					"left": -252
				}, 200)
			});
			$("#shangou_bg_main_submenu").find("span:first").click(function() {
				$("#shangou_bg_main_submenu").find("span").removeClass("hover");
				$(this).addClass("hover");
				$("#shangou_bg_main_shangou").show();
				$("#shangou_bg_main_mryg").hide();
			})
			$("#shangou_bg_main_submenu").find("span:last").click(function() {
				$("#shangou_bg_main_submenu").find("span").removeClass("hover");
				$(this).addClass("hover");
				$("#shangou_bg_main_shangou").hide();
				$("#shangou_bg_main_mryg").show();
			})
			
		</script>
	</body>

</html>